package com.yanqu.road.server.pb;

import com.yanqu.road.entity.activity.channelmusicroomrank.CrossChannelMusicRoomRankShowData;
import com.yanqu.road.entity.activity.channelmusicroomrank.UserChannelMusicRoomRankBeautyData;

import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.logic.pb.PlayerBasePb;
import com.yanqu.road.pb.activity.ChannelMusicRoomRankProto;

public class ChannelMusicRoomRankPb {
    public static ChannelMusicRoomRankProto.ChannelMusicRoomRankBeautyTemp.Builder parseBeautyTemp(UserChannelMusicRoomRankBeautyData beautyData) {
        ChannelMusicRoomRankProto.ChannelMusicRoomRankBeautyTemp.Builder builder = ChannelMusicRoomRankProto.ChannelMusicRoomRankBeautyTemp.newBuilder();
        builder.setBeautyId(beautyData.getBeautyId());
        builder.setSkinId(beautyData.getSkinId());
        builder.setFreeTimes(beautyData.getFreeTimes());
        builder.setItemTimes(beautyData.getItemTimes());
        builder.setJoinRound(beautyData.getJoinRound());

        return builder;
    }

    public static ChannelMusicRoomRankProto.ChannelMusicRoomRankShowTemp.Builder parseBeautyShowTemp(CrossChannelMusicRoomRankShowData beautyShowData, UserBaseInfo userBaseInfo, boolean isRank) {
        ChannelMusicRoomRankProto.ChannelMusicRoomRankShowTemp.Builder builder = ChannelMusicRoomRankProto.ChannelMusicRoomRankShowTemp.newBuilder();
        builder.setBeautyId(beautyShowData.getBeautyId());
        builder.setSkinId(beautyShowData.getSkinId());
        builder.setScore(beautyShowData.getShowScore());
        builder.setUserBaseInfo(PlayerBasePb.parsePlayerBaseTempMsg(userBaseInfo));
        if (isRank) {
            builder.setIndex(beautyShowData.getRank());
        } else {
            builder.setIndex(beautyShowData.getJoinPos());
        }
        return builder;
    }
}
